package 华为.text06_质数因子;

import java.io.IOException;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        long num = scanner.nextLong();
        handle(num);
    }

    public static void handle(long num){
        long k = (long) Math.sqrt(num) + 2;
        for (int i = 2; i <= k; i++) {
            while (num%i==0){
                System.out.print(i+" ");
                num=num/i;
                handle(num);
                return;

            }
            if (i==k){
                System.out.print(num);
            }
        }
    }
}